<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">

{{ partial "head.html" . }}

<body>
  <div id="all">

    <header>

      {{ partial "nav.html" . }}

    </header>

    <div id="content">
      <iframe src={{ i18n "blogs_iframe" }} id="blogIframe" width="100%" scrolling="no" frameborder="0"></iframe>
    </div>

    {{ partial "footer.html" . }}
  </div>
  
  {{ partial "scripts.html" . }}

  <script>
    var hash = window.location.search.substr(1);
    var blogIframe = document.getElementById('blogIframe');
    blogIframe.src += hash;
    window.addEventListener('message', function(messageEvent) {
      var data = messageEvent.data;
      
      if(!isNaN(data)) {
        blogIframe.height = data;
      }else if(typeof data === "string") {
        console.log("我是父页面", data)
        window.history.replaceState(null,null,"?"+ data)
      }
    }, false);
  </script>
  
</body>

</html>